﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PepsiCo.Business
{
    public partial class pepsi_User : BaseClass
    {
        public Right GetRight(int functionID)
        {
            Right retRight = Right.None;
            var user_roles = DB.pepsi_User_Roles.Where(p => p.UserID == this.UserID);
            foreach (var item in user_roles)
            {
                retRight = retRight | DB.pepsi_Roles.FirstOrDefault(p => p.RoleId == item.RoleID).GetRight(functionID);
            }
            return retRight;
        }
    }
}
